package com.nbsaas.boot.shop.rest.resource;

import com.nbsaas.boot.shop.api.apis.ShopBannerApi;
import com.nbsaas.boot.shop.data.entity.ShopBanner;
import com.nbsaas.boot.shop.api.domain.request.ShopBannerRequest;
import com.nbsaas.boot.shop.api.domain.response.ShopBannerResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopBannerSimple;
import com.nbsaas.boot.shop.rest.convert.ShopBannerSimpleConvert;
import com.nbsaas.boot.shop.rest.convert.ShopBannerEntityConvert;
import com.nbsaas.boot.shop.rest.convert.ShopBannerResponseConvert;
import com.nbsaas.boot.shop.data.repository.ShopBannerRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class ShopBannerResource extends BaseResource<ShopBanner,ShopBannerResponse, ShopBannerSimple, ShopBannerRequest>  implements ShopBannerApi {

    @Resource
    private ShopBannerRepository shopBannerRepository;

    @Override
    public JpaRepositoryImplementation<ShopBanner, Serializable> getJpaRepository() {
        return shopBannerRepository;
    }

    @Override
    public Function<ShopBanner, ShopBannerSimple> getConvertSimple() {
        return new ShopBannerSimpleConvert();
    }

    @Override
    public Function<ShopBannerRequest, ShopBanner> getConvertForm() {
        return new ShopBannerEntityConvert();
    }

    @Override
    public Function<ShopBanner, ShopBannerResponse> getConvertResponse() {
        return new ShopBannerResponseConvert();
    }




}


